renderbackground: Pull out a gdk_rgba_is_clear check
authorTimm Bäder <mail@baedert.org>
Tue, 9 Jan 2018 04:59:19 +0000 (05:59 +0100)
committerTimm Bäder <mail@baedert.org>
Wed, 10 Jan 2018 07:46:22 +0000 (08:46 +0100)
We only call snapshot_color once, and this way it's clearer that nothing
will happen for a clear color from the caller side.

gtk/gtkrenderbackground.c

index 0d3f31a671472512d45d753d5e780e11a6dc52ad..612c9c01bfda24bdf48fc7be78f05b078d09ea11 100644 (file)
@@ -86,9 +86,6 @@ gtk_theming_background_snapshot_color (GtkThemingBackground *bg,
      (gtk_css_style_get_value (bg->style, GTK_CSS_PROPERTY_BACKGROUND_CLIP), 
       n_values - 1));
 
-  if (gdk_rgba_is_clear (bg_color))
-    return;
-
   if (gsk_rounded_rect_is_rectilinear (&bg->boxes[clip]))
     {
       gtk_snapshot_append_color (snapshot,
@@ -658,7 +655,8 @@ gtk_css_style_snapshot_background (GtkCssStyle      *style,
         gtk_snapshot_push_blend (snapshot, blend_mode, "Background<%u>Blend<%u>", idx, blend_mode);
     }
 
-  gtk_theming_background_snapshot_color (&bg, snapshot, bg_color, background_image);
+  if (!gdk_rgba_is_clear (bg_color))
+    gtk_theming_background_snapshot_color (&bg, snapshot, bg_color, background_image);
 
   for (idx = number_of_layers - 1; idx >= 0; idx--)
     {